# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-google-smaug
pkgdesc="Google Pixel C"
pkgver=3
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
	depthcharge-tools
	linux-google-smaug
	postmarketos-base
"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
makedepends="devicepkg-dev"
source="
	30-xusb-firmware.files
	deviceinfo
	modules-initfs
"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname
}

nonfree_firmware() {
	pkgdesc="WiFi/BT, USB and GPU firmware"
	depends="linux-firmware-brcm linux-firmware-nvidia firmware-google-smaug"

	# Firmware needed to boot from USB
	install -Dm644 "$srcdir"/30-xusb-firmware.files \
		"$subpkgdir"/usr/share/mkinitfs/files/30-xusb-firmware.files
}

sha512sums="
80d1ff3ae3045cb071d0eb7ac53cebccfe363a9584ef806e7b79309231c58d00f89612423440526a08b14fc80e96162b8f429f453f662d4c438c787fa45ef122  30-xusb-firmware.files
1ee3d0eada4435181f8c70ead25f1dbd1afc6389819afc5c1fb0d45ee6ab936fd52352a3362697e6a8f27fe5fa8f8149b7a602eaf60f908010b4e265fd8073e7  deviceinfo
d883fa37ea89379aec31e518714adbef76d0c260929deb05c131c5df4c532344f3358a82cc39e81d06da821df81171709cd9dc20837795bee6834c34d4dfa47a  modules-initfs
"
